﻿@model _17bangMVC.Models.Article.NewModel

@{
    ViewBag.Title = "文章发布.一起帮";

    IDictionary<int, string> adddefault = new Dictionary<int, string>
{
        {1,"默认分类" },
};
    IDictionary<int, string> ad = new Dictionary<int, string>
{
        {1,"-----使用新的广告-----" },
};
}
<style>
    .field-validation-error {
        color: red;
        font-size: 12px;
        display: inline-block;
        font: normal normal normal 14px/1 FontAwesome;
        font-size: inherit;
        text-rendering: auto;
        -webkit-font-smoothing: antialiased;
    }

        .field-validation-error::before {
            content: '\f119';
        }
</style>

<h2>文章发布</h2>
<hr />

@using (Html.BeginForm())
{
    <label><b>标题：（必填）</b></label>
    @Html.TextBoxFor(m => m.Title, new
{
    @class = "form-control",
    placeholder = "来一个醒目的标题吧"
})
    @Html.ValidationMessageFor(m => m.Title)
    <br />
    <label><b>内容：（必填）</b></label>
    @Html.TextAreaFor(m => m.Description, new
{
    @class = "form-control",
    style = "height:300px"
})
    @Html.ValidationMessageFor(m => m.Description)
    <br />
    <label><b>添加到系列：</b></label>
    @Html.DropDownListFor(m => m.Default, new SelectList(adddefault, "key", "value"))
    <span><a href="">✚新系列</a></span>
    <br />
    <label><b>关键字：（*必填）</b></label>
    @Html.TextBoxFor(m => m.Keyword, new
{
 @class = "form-control",
 placeholder = "用空格分隔，总长度不超过25个字符"

})
    @Html.ValidationMessageFor(m => m.Keyword)
    <br />
    <label><b>摘要:（*建议填写</b></label>
    @Html.TextAreaFor(m => m.Abstract, new
{
    @class = "form-control",
    placeholder = "不填写的话，系统会截取文章前255字作为摘要显示"
})
    <br />
    <label><b>之前用过的广告：</b></label>
    @Html.DropDownListFor(m => m.AD, new SelectList(ad, "key", "value"), new
{
    @class = "form-control",
})
    <br />
    <div class="alert alert-warning" style="display:block;border: 1px dashed">
        <br />
        <label><b>文字内容：（必填）</b></label>
        @Html.TextBoxFor(m => m.Text, new
    {
       @class = "form-control",
       placeholder = "最多不超过24个字符"
    })
        @Html.ValidationMessageFor(m => m.Text)
        <br />
        <label><b>链接：（必填）</b></label>
        @Html.TextBoxFor(m => m.Link, new
    {
       @class = "form-control",
       placeholder = "http或https开头的网址"
    })
        @Html.ValidationMessageFor(m => m.Link)
    </div>
    <button type="submit" class="btn btn-primary">发布为最新</button>
    <button type="button" class="btn btn-light">保存基本内容</button>
    @Html.AntiForgeryToken()
}


